<template>
    <div>
        <Form :model="form" label-position="left" :label-width="100">
            <FormItem label="填报部门"  prop="title" >
                <Input v-model="form.bmA" style="width: 25%;" disabled></Input>
            </FormItem>
            <FormItem label="月度"  prop="title" >
                <Input v-model="form.dated" style="width: 25%;" disabled></Input>
            </FormItem>
        </Form>
        <Form :model="formItem">
            <FormItem style="float:left;width: 100%">
                <label><b>本单位调度情况</b></label>
                <Alert type="warning" style="width: 100%">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">本单位内部调度次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中一把手调度次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">参加本单位调度的市管干部人次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">调度处级（中层干部）人次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">三方专班人数合计：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.company_num" type="number">
                        <span slot="prepend">本单位内部调度次数</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.company_one_num" type="number">
                        <span slot="prepend">其中一把手调度次数</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.company_cadres_num" type="number">
                        <span slot="prepend">参加本单位调度的市管干部人次数</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 20px">
                    <Col span="8"><Input v-model="formItem.company_rank_num" type="number">
                        <span slot="prepend">调度处级（中层干部）人次数</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.company_special_class" type="number">
                        <span slot="prepend">三方专班人数合计</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>梳理业务流程情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">梳理排查业务数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">梳理发现存在问题漏洞数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中：本单位自查发现问题漏洞数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">列入2020年体系建设重点任务的业务数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">2020年本单位财政预算项目专项数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">2020年本单位财政预算项目总金额（万元）：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.process_carding_num" type="number">
                        <span slot="prepend">梳理排查业务数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.process_problem_num" type="number">
                        <span slot="prepend">梳理发现存在问题漏洞的数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.process_company_num" type="number">
                        <span slot="prepend">其中：本单位自查发现问题漏洞数量</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 20px">
                    <Col span="8"><Input v-model="formItem.process_key_num" type="number">
                        <span slot="prepend">列入2020年体系建设重点任务的业务数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.process_finance_num" type="number">
                        <span slot="prepend">2020年本单位财政预算项目专项数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.process_finance_moeny" type="number">
                        <span slot="prepend">2020年本单位财政预算项目总金额（万元）</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>堵塞漏洞情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">本单位提出内部防控（自我监督）措施数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">已完成问题漏洞堵塞的数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.process_supervise_num" type="number">
                        <span slot="prepend">本单位提出内部防控（自我监督）措施数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.process_plugging_num" type="number">
                        <span slot="prepend">已完成问题漏洞堵塞的数量</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>梳理完善政策规定情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">梳理掌握的现有政策规定文件数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">修订完善的政策规定文件数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">新制定的政策规定文件数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">开展体系建设以来，取消、下放权力数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.policy_regulations_num" type="number">
                        <span slot="prepend">梳理掌握的现有政策规定文件数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.policy_update_num" type="number">
                        <span slot="prepend">修订完善的政策规定文件数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.policy_new_num" type="number">
                        <span slot="prepend">新制定的政策规定文件数量</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.policy_decentralization_num" type="number">
                        <span slot="prepend">开展体系建设以来，取消、下放权力数</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>系统建设情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">现有信息系统数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">基于体系建设，新建系统平台数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中：已建成数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">基于体系建设，改旧系统平台数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中：已完成改旧数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">基于体系建设，已利旧系统平台数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">已实现市区（县）上下贯通的系统平台数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">跨部门（非本单位）数据需求种类数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">数据需求涉及提供方单位数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">拟纳入市信息中心共建共享平台的业务数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.system_now_num"  type="number">
                        <span slot="prepend">现有信息系统数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_platform_num"  type="number">
                        <span slot="prepend">基于体系建设，新建系统平台数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_success_num"  type="number">
                        <span slot="prepend">其中：已建成数量</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.system_modify_num"  type="number">
                        <span slot="prepend">基于体系建设，改旧系统平台数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_update_low_num"  type="number">
                        <span slot="prepend">其中：已完成改旧数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_utilize_low_num"  type="number">
                        <span slot="prepend">基于体系建设，已利旧系统平台数量</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.system_city_num"  type="number">
                        <span slot="prepend">已实现市区（县）上下贯通的系统平台数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_department_num"  type="number">
                        <span slot="prepend">跨部门（非本单位）数据需求种类数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.system_provide_num"  type="number">
                        <span slot="prepend">数据需求涉及提供方单位数量</span>
                    </Input></Col>
                </Row>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.system_share_num"  type="number">
                        <span slot="prepend">拟纳入市信息中心共建共享平台的业务数量</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>体系建设成效情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">目前已避免发生问题的数量：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">每年可节约资金或避免经济损失（万元）：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">开展体系建设以来已挽回经济损失（万元）：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px">
                    <Col span="8"><Input v-model="formItem.data_avoid_num" type="number">
                        <span slot="prepend">目前已避免发生问题的数量</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.data_save_num" type="number">
                        <span slot="prepend">每年可节约资金或避免经济损失（万元）</span>
                    </Input></Col>
                    <Col span="8"><Input v-model="formItem.data_system_num" type="number">
                        <span slot="prepend">开展体系建设以来已挽回经济损失（万元）</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem label="附件上传">
                <Row :gutter="16">
                    <Col>
                        <wl-upload-oss-files
                                v-model="formItem.data_file"
                                :maxNum="1"
                                uploadType="hadoop"
                                uploadStyle="other"
                                uploadUrl='http://218.60.17.11:33685/api/ac/file/fileCommonService/upLoadFiles'
                                getSignUrl="/api/ac/jwork/getHadoopService/getSign"
                                fileName="origin"
                                :beforeUploadFilter="uploadFilter"
                                :format="['doc','docx']"
                                fileDir="/jov/">
                        </wl-upload-oss-files>
                    </Col>
                </Row>
                <Row :gutter="16">
                    <Col style="margin-left:65px">请上传节约、避免、挽回经济损失的文字说明材料，格式为Word文档</Col>
                </Row>
            </FormItem>
            <FormItem style="float:left;width: 100%">
                <label><b>媒体宣传推广情况</b></label>
                <Alert type="warning">
                    <Icon type="ios-warning-outline" /><label><b>填写说明</b></label><br>
                    <p style="margin-top: 10px;margin-left: 25px">市级以上媒体宣传推广次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中国家级次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中省级次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                    <p style="margin-top: 10px;margin-left: 25px">其中市级次数：是指_ _ _ _ _ _ _ _ _ _ _</p>
                </Alert>
                <Row :gutter="16" style="padding-top: 10px;">
                    <Col span="6"><Input v-model="formItem.extension_num" type="number">
                        <span slot="prepend">市级以上媒体宣传推广次数</span>
                    </Input></Col>
                    <Col span="6"><Input v-model="formItem.extension_national_num" type="number">
                        <span slot="prepend">其中国家级次数</span>
                    </Input></Col>
                    <Col span="6"><Input v-model="formItem.extension_province_num" type="number">
                        <span slot="prepend">其中省级次数</span>
                    </Input></Col>
                    <Col span="6"><Input v-model="formItem.extension_city_num" type="number">
                        <span slot="prepend">其中市级次数</span>
                    </Input></Col>
                </Row>
            </FormItem>
            <FormItem label="附件上传">
                <Row :gutter="16">
                    <Col>
                        <wl-upload-oss-files
                                v-model="formItem.excel_impor"
                                :maxNum="1"
                                uploadType="hadoop"
                                uploadStyle="other"
                                uploadUrl='http://218.60.17.11:33685/api/ac/file/fileCommonService/upLoadFiles'
                                getSignUrl="/api/ac/jwork/getHadoopService/getSign"
                                fileName="origin"
                                :beforeUploadFilter="uploadFilter"
                                :format="['doc','docx']"
                                fileDir="/jov/">
                        </wl-upload-oss-files>
                    </Col>
                </Row>
                <Row :gutter="16">
                    <Col style="margin-left:65px">宣传报道支撑材料附件上传（链接、截图、文字等），格式为Word文档。下载模板请点击后面链接：<a href="http://house-manager.oss-cn-qingdao.aliyuncs.com/%E7%9B%91%E7%9D%A3%E6%B2%BB%E7%90%86%E4%BD%93%E7%B3%BB%E6%8F%90%E6%8A%A5/%E5%AA%92%E4%BD%93%E5%AE%A3%E4%BC%A0%E6%8E%A8%E5%B9%BF%E6%83%85%E5%86%B5%E5%A1%AB%E6%8A%A5%E8%A1%A8.xlsx"><Icon type="md-download" />《媒体宣传推广情况填报表》</a></Col>
                </Row>
            </FormItem>
            <FormItem style="margin-top: 30px">
                <Row :gutter="16">
                    <Col span="19">
                        <div style="margin-bottom: -8%;width: 30px;text-align: center">备注</div>
                        <Input v-model="formItem.remark" type="textarea" :autosize="{minRows: 5,maxRows: 5}" maxlength="500" show-word-limit style="margin-left: 10%;width: 60%;margin-top: 50px">
                        </Input>
                    </Col>
                </Row>
            </FormItem>
            <Row type="flex" justify="center" class="code-row-bg" style="margin-top: 20px">
                <Col>
                    <Button type="success" @click="submit()">提报</Button>
                </Col>
            </Row>
            <Row type="flex" justify="center" class="code-row-bg" style="margin-top: 20px">
                <Col>
                    <span>建设情况统计信息可多次提报</span>
                </Col>
            </Row>
        </Form>
    </div>
</template>

<script>
import { insertZlShiZhi, getZlShiZhiByCodeList } from '@/api/user'
export default {

  name: 'test',

  data () {
    return {
      month: '',
      form: {
        bmA: '',
        dated: ''
      },
      formItem: {
        company_num: '',
        company_one_num: '',
        company_cadres_num: '',
        company_rank_num: '',
        process_carding_num: '',
        process_problem_num: '',
        process_supervise_num: '',
        process_plugging_num: '',
        process_avoid_num: '',
        policy_regulations_num: '',
        policy_update_num: '',
        policy_new_num: '',
        system_new_num: '',
        system_share_num: '',
        data_avoid_num: '',
        data_save_num: '',
        data_system_num: '',
        extension_num: '',
        excel_impor: '',
        remark: '',
        company_special_class: '',
        process_company_num: '',
        process_key_num: '',
        process_finance_num: '',
        process_finance_moeny: '',
        policy_decentralization_num: '',
        system_now_num: '',
        system_platform_num: '',
        system_success_num: '',
        system_modify_num: '',
        system_update_low_num: '',
        system_utilize_low_num: '',
        system_city_num: '',
        system_department_num: '',
        system_provide_num: '',
        data_file: ''
      }
    }
  },

  props: {

  },

  components: {

  },

  computed: {

  },

  methods: {
    async init () {
      var myDate = new Date()
      myDate.getFullYear() // 获取完整的年份(4位,1970-????)
      myDate.getMonth() // 获取当前月份(0-11,0代表1月)
      let y = myDate.getFullYear()
      let d = myDate.getMonth()
      if (d < 10) {
        d = '0' + d
      }
      let yd = y + '年' + d + '月'
      this.form.dated = yd
      this.month = y + '-' + d
      if (this.$route.query.para !== undefined) {
        this.formItem = this.$route.query.para
        this.form.bmA = this.$route.query.para.department_name
      } else {
        this.form.bmA = this.$store.state.user.severUserInfo.data.company_name
      }
      getZlShiZhiByCodeList().then(ret => {
        if (ret.data.errcode === 0) {
          if (ret.data.data !== '' || ret.data.data !== undefined) {
            this.formItem.company_num = ret.data.data[0].company_num
            this.formItem.company_one_num = ret.data.data[0].company_one_num
            this.formItem.company_cadres_num = ret.data.data[0].company_cadres_num
            this.formItem.company_rank_num = ret.data.data[0].company_rank_num
            this.formItem.company_special_class = ret.data.data[0].company_special_class
            this.formItem.process_carding_num = ret.data.data[0].process_carding_num
            this.formItem.process_problem_num = ret.data.data[0].process_problem_num
            this.formItem.process_company_num = ret.data.data[0].process_company_num
            this.formItem.process_key_num = ret.data.data[0].process_key_num
            this.formItem.process_finance_num = ret.data.data[0].process_finance_num
            this.formItem.process_finance_moeny = ret.data.data[0].process_finance_moeny
            this.formItem.process_supervise_num = ret.data.data[0].process_supervise_num
            this.formItem.process_plugging_num = ret.data.data[0].process_plugging_num
            this.formItem.policy_regulations_num = ret.data.data[0].policy_regulations_num
            this.formItem.policy_update_num = ret.data.data[0].policy_update_num
            this.formItem.policy_new_num = ret.data.data[0].policy_new_num
            this.formItem.policy_decentralization_num = ret.data.data[0].policy_decentralization_num
            this.formItem.system_now_num = ret.data.data[0].system_now_num
            this.formItem.system_platform_num = ret.data.data[0].system_platform_num
            this.formItem.system_success_num = ret.data.data[0].system_success_num
            this.formItem.system_modify_num = ret.data.data[0].system_modify_num
            this.formItem.system_update_low_num = ret.data.data[0].system_update_low_num
            this.formItem.system_utilize_low_num = ret.data.data[0].system_utilize_low_num
            this.formItem.system_city_num = ret.data.data[0].system_city_num
            this.formItem.system_department_num = ret.data.data[0].system_department_num
            this.formItem.system_provide_num = ret.data.data[0].system_provide_num
            this.formItem.system_share_num = ret.data.data[0].system_share_num
            this.formItem.data_avoid_num = ret.data.data[0].data_avoid_num
            this.formItem.data_save_num = ret.data.data[0].data_save_num
            this.formItem.data_system_num = ret.data.data[0].data_system_num
            this.formItem.data_file = ret.data.data[0].data_file
            this.formItem.extension_num = ret.data.data[0].extension_num
            this.formItem.extension_national_num = ret.data.data[0].extension_national_num
            this.formItem.extension_province_num = ret.data.data[0].extension_province_num
            this.formItem.extension_city_num = ret.data.data[0].extension_city_num
            this.formItem.excel_impor = ret.data.data[0].excel_impor
            this.formItem.remark = ret.data.data[0].remark
          } else {}
        } else {
          this.$Message.error('数据加载失败！！！' + ret.data.errmsg)
        }
        console.log(ret, 'ret#@!')
      })
      // console.log(yd, '月度')
      // console.log(this.month, '月度')
    },
    submit (nodesc) {
      // console.log(this.formItem, '!!!!!!!!!')
      if (this.formItem.id === undefined) {
        this.formItem.monthly = this.month
        insertZlShiZhi(this.formItem).then(ret => {
          // console.log(ret.data.errmsg, '!!!!!!!!@@@@@@@')
          if (ret.data.errcode === 0) {
            this.$Message.success('提报成功')
            this.$router.push({
              name: 'dataAcquisitions'
            })
          } else {
            this.$Notice.error({
              title: '填报失败',
              desc: nodesc ? '' : '一个用户每月只能填报一条数据！！！！！！'
            })
          }
        })
      } else {
        this.formItem.id = this.$route.query.para.id
        this.formItem.monthly = this.month
        insertZlShiZhi(this.formItem).then(ret => {
          // console.log(ret.data.errmsg, '!!!!!!!!@@@@@@@')
          if (ret.data.errcode === 0) {
            this.$Message.success('修改成功')
            this.$router.push({
              name: 'dataAcquisitions'
            })
          } else {
            this.$Message.error('修改失败' + ret.data.errmsg)
          }
        })
      }
    },
    uploadFilter (file, uploadList, filterReturn) {
      console.log(this.url, 'uploadList')
      let isExit = false
      if (uploadList.length > 0) {
        uploadList.forEach(item => {
          if (item.url.indexOf(file.name) !== -1) {
            isExit = true
          }
        })
      }
      if (isExit) {
        this.errMsgAction(file.name, '【文件已经存在】')
        return { errcode: false, selfShow: true }
      }
      return { errcode: true }
    }
  },

  watch: {

  },

  mounted () {
    this.init()
  }

}
</script>

<style scoped>

</style>
